param([string]$tempFile)


function create-setting([string]$settingName, [hashtable]$values) {

    $obj = New-Object System.Object
    $obj | Add-Member -type NoteProperty -name Settings -Value $settingName
    $obj | Add-Member -type NoteProperty -name Defaults -Value $values.Defaults
    $obj | Add-Member -type NoteProperty -name Local -Value $values.Local
    $obj | Add-Member -type NoteProperty -name Dev -Value $values.Dev
    $obj | Add-Member -type NoteProperty -name Test -Value $values.Test
    $obj | Add-Member -type NoteProperty -name Integration -Value $values.Integration
    $obj | Add-Member -type NoteProperty -name Production -Value $values.Production

    return $obj
}

$settings = @()
$settings += create-setting 'setting1' @{Defaults='setting1default'}
$settings += create-setting 'setting2' @{Defaults='setting2default'}
$settings += create-setting 'setting3' @{Defaults='setting3default'}
$settings += create-setting 'setting4' @{Defaults='setting4,default'; Local='localhost'; Test='testserver'; Dev='devserver'; Integration='intgserver'; Production='prodserver'}
$settings += create-setting 'setting5' @{Defaults='${setting1}'; Local='"${setting1}"'; Test='${setting1}'; Dev='${setting1}'; Integration='${setting1}'; Production='${setting1}'}

$settings | export-csv $tempFile
#$settings | export-csv $tempFile -NoTypeInformation
